package apiday02_homework;
//定义字符串String
// path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";
//要求得到并输出：参数名:name 参数值：zhangsan
//参数名:pwd 参数值: 123456
//参数名:nick 参数值: san
// 参数名:age 参数值: 16
public class Expand {
    public static void main(String[] args) {
        String path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";
        String[] arr = path.split("\\?");
        System.out.println(arr[0]);
        System.out.println(arr[1]);

        arr = arr[1].split("&");

        for(int i=0;i<arr.length;i++){
            String[] arr1 = arr[i].split("=");
            System.out.println("参数名："+arr1[0]+" 参数值"+arr1[1]);
        }


    }
}
